<template>
  <div class="header">
    <div class="left" @click="goBack">
      <slot name="left">
      </slot>
    </div>
    <div class="center">
      <slot name="center">登录</slot>
    </div>
    <div class="right" @click="goPerson">
      <slot name="right">
      </slot>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    goBack() {
      this.$router.back()
    },
    goPerson() {
      this.$router.push({
        name: 'my'
      })
    }
  }
}
</script>

<style scoped lang="less">
.header {
  display: flex;
  height: 44px;
  text-align: center;
  line-height: 44px;
  background-color: #b0352f;
  color: #fff;
  font-size: 16px;

  .left {
    width: 44px;
  }

  .center {
    flex: 1;
  }

  .right {
    width: 44px;
  }
}
</style>

